package grape.common.service.common;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.additional.AlwaysUpdateSomeColumnById;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by yangwei
 * Created at 2020/7/22 15:37
 */
@Component
public class CustomSqlInjector extends DefaultSqlInjector {
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass);

        methodList.add(new AlwaysUpdateSomeColumnById());
        return methodList;
    }

}
